package com.igroupes.ovineherd.raw.service;

import com.igroupes.ovineherd.dto.UserInfo;
import com.igroupes.ovineherd.dto.response.ModelDataJsonListResponse;
import com.igroupes.ovineherd.model.IParentModelData;
import com.igroupes.ovineherd.model.ModelData;
import com.igroupes.ovineherd.dto.request.ModelOrderRequest;
import com.igroupes.ovineherd.model.dto.ModelVersionResponse;
import com.igroupes.ovineherd.model.dto.ModelDataAddRequest;
import com.igroupes.ovineherd.model.table.TableAttribute;

import java.util.List;

public interface IModelService {

    ModelData getFieldTemplate();
    Boolean modelAdd(ModelDataAddRequest modelDataAddRequest,Long userId);
    Boolean modelDelete(Long tableId, Long userId);

    Boolean tableEdit(TableAttribute table, Long tableId, Long userId);
    Boolean fieldDelete(long fieldId, Long userId);

    Boolean fieldAddV2(IParentModelData field, Long tableId, Long userId);

    Boolean fieldsAdd(List<IParentModelData> field, Long tableId, Long userId);

    Boolean fieldEditV2(IParentModelData field, long fieldId, Long userId);

    List<ModelDataJsonListResponse> tableListV2(Long userId);
    List<ModelDataJsonListResponse> tablePublishListV2(Long userId);

    ModelDataJsonListResponse tableInfo(Long tableId);

    /**
     * 所有版本
     * @param userId
     * @return
     */
    List<ModelVersionResponse> getVersionList(Long userId);

    Boolean publish(Long userId);
    Boolean rollback(Long userId, Long versionId);

    Boolean order(List<ModelOrderRequest> modelOrderRequests, UserInfo userInfo);
}
